home *** CD-ROM | disk | FTP | other *** search
- /**
- * Copyright (C) 2000 - DivXNetworks
- **/
- // codec.h //
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #ifndef _CODEC_H_
- #define _CODEC_H_
-
- class codec {
-
- private:
- float framerate;
-
- //operations
- public:
- codec();
- ~codec();
- long about(LPARAM lParam1, LPARAM lParam2);
- long config(LPARAM lParam1, LPARAM lParam2);
- long getInfo(LPARAM lParam1, LPARAM lParam2);
- long encGetFormat(LPARAM lParam1, LPARAM lParam2);
- long encGetSize(LPARAM lParam1, LPARAM lParam2);
- long encQuery(LPARAM lParam1, LPARAM lParam2);
- long encFramesInfo(LPARAM lParam1, LPARAM lParam2);
- long encBegin(LPARAM lParam1, LPARAM lParam2);
- long encEncode(LPARAM lParam1, LPARAM lParam2);
- long encEnd(LPARAM lParam1, LPARAM lParam2);
- long decGetFormat(LPARAM lParam1, LPARAM lParam2);
- long decQuery(LPARAM lParam1, LPARAM lParam2);
- long decBegin(LPARAM lParam1, LPARAM lParam2);
- long decDecode(LPARAM lParam1, LPARAM lParam2);
- long decEnd(LPARAM lParam1, LPARAM lParam2);
-
- // decoder set
- long decSetPostProcessing(LPARAM lParam1, LPARAM lParam2);
-
- private:
- int getImageType(BITMAPV4HEADER *bmpinfohdr);
- void convertImage(void *imageIn, void *imageOut, long type, long x_dim, long y_dim);
- void InitLookupTable();
- int convertRGB (void *bmp, void *yuv, long type, long x_dim, long y_dim);
- int convertYUV422 (void *yuv422, void *yuv, long type, long x_dim, long y_dim);
- int convertYUV420 (void *yuv420, void *yuv, long type, long x_dim, long y_dim);
- };
-
- #endif // _CODEC_H_
-
- #include <vfw.h>
-
- static const DWORD FOURCC_DIVX = mmioFOURCC('D','I','V','X'); // DivX format
- static const DWORD FOURCC_UYVY = mmioFOURCC('U','Y','V','Y'); // uncompressed UYVY
- static const DWORD FOURCC_YUY2 = mmioFOURCC('Y','U','Y','2'); // uncompressed YUY2
- static const DWORD FOURCC_YUYV = mmioFOURCC('Y','U','Y','V'); // uncompressed YUYV - same as YUY2
- static const DWORD FOURCC_V422 = mmioFOURCC('V','4','2','2'); // uncompressed V422 - same as YUY2
- static const DWORD FOURCC_YVYU = mmioFOURCC('Y','V','Y','U'); // uncompressed YVYU
- static const DWORD FOURCC_YV12 = mmioFOURCC('Y','V','1','2'); // uncompressed YV12 - MPEG format of choice
- static const DWORD FOURCC_I420 = mmioFOURCC('I','4','2','0'); // uncompressed I420
- static const DWORD FOURCC_IYUV = mmioFOURCC('I','Y','U','V'); // uncompressed IYUV - same as I420
-
- extern long rc_period, bitrate;
- extern int search_range;
- extern int max_quantizer;
- extern int min_quantizer;
-
- #ifdef __cplusplus
- }
- #endif
-